package com.wonders.frame;

import com.wonders.frame.autoGeneration.support.enums.DatasourceOperatorEnum;
import com.wonders.frame.autoGeneration.support.enums.ExecutorServiceEnum;
import com.wonders.frame.common.Enum.InitCommonSourceEnum;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@EnableTransactionManagement
@EnableConfigurationProperties
@RestController
@EnableCaching
public class FrameApp {
    public static void main(String[] args) {
        SpringApplication.run(FrameApp.class);
        //初始化一些资源
        InitCommonSourceEnum.INSTANCE.name();
        ExecutorServiceEnum.INSTANCE.name();
        DatasourceOperatorEnum.INSTANCE.name();
    }

    @RequestMapping("healthCheck")
    public String health() {
        return "{\"code\":\"200\"}";
    }
    @RequestMapping("sayHello")
    public String sayHello() {
        return "I'm frame!";
    }
}

